﻿using UnityEngine;

namespace BToolkit
{
    public class Rotate : MonoBehaviour
    {

        public Vector3 velocity = Vector3.one * 100;

        private Vector3 defaultAngle;

        private void Awake()
        {
            defaultAngle = transform.localEulerAngles;
        }

        private void OnEnable()
        {
            transform.localEulerAngles = defaultAngle;
        }

        void Update()
        {
            transform.Rotate(velocity * Time.deltaTime);
        }
    }
}